Calibration
Easily add measurement or dimensioning tools to your web, mobile, or desktop app. Use built-in calibration tools to define a drawing's or plan's scale.
API
startCreate
Create a calibration. You can select between Area, Annotations, Measure and Perimeter.
| Param | Type | Description |
|---|---|---|
| tool | string | Select the desired tool |
| [single] | bool | Select true to make a single measure, false to make a multi-point measure |
| [color] | string | Change the color of the annotation tool |
| [showLength] | bool | Toogle visibility of the length drawing of the measure - area and perimeter tool |
| [single] | bool | Select true to make a single measure, false to make a multi-point measure |
| [guid] | string | Set a group_guid if you want to add a pin to an existing group |
Available tool options:
- annotation: Select the annotation tool.
- measure: Select measure tool.
- area: Select area tool.
- perimeter: Select perimeter tool.
- calibration: Set a calibration to match the scale of the plan on the pdf.
Example
TFTPDFGadget.callCommand({
name: "startCreate",
args: {
tool: "perimeter",
showLength: "false",
},
callback: myfunc,
});
setCalibration ⇒ JSON
Set your paper/plan's scale.
| Param | Type | Description |
|---|---|---|
| measureL | number | The measure reading from overlay |
| measureX | number | The desired measure to make a calibration |
| unit | string | The unit to display |
Available unit options:
- cm: Select centimeters as the unit to display.
- mm: Select millimeters as the unit to display.
- m: Select meters as the unit to display.
Example
TFTPDFGadget.callCommand({
name: "setCalibration",
args: { measureL: 2500, measureX: 150, unit: "m" },
callback: myfunc,
});
resetCalibration
Reset the current Calibration.
Example
TFTPDFGadget.callCommand({
name: "resetCalibration",
callback: myfunc,
});